CLICK ON IT TO START PLAYING.

function setup() {
  createCanvas(400, 400);
  background(0);
}
var x = 0;
var y = 0;

function draw() {
  stroke(155);
  if(random(1) > 0.5) {
    line(0 + x, y, 10 + x, y + 10);
  } else {
    line(10 + x, y, x, y + 10);
  }
  x = x + 10;
  if(x > width) {
    x = 0;
    y = y + 10;
  }
  if(y > height) {
    noLoop();
  }
}